#include<bits/stdc++.h>
#define int long long
#define endl "\n"

using namespace std;

signed main() {
	int n;
	cin >> n;
	string s;
	cin >> s;
	int ma = 0;
	string ret = "";
	map<char, int>mp;
	
	for(int i = 0; i < n; i ++ ) {
		mp[s[i]] ++;
		if(ma < mp[s[i]]) {
			ma = mp[s[i]];
			ret = s[i];
		}	
	}
	cout << ret << endl;
	return 0;
}

